fix: don't intercept forms without explicit f-partial inside f-client-nav#3722
Merged
Conversation
…-nav (#3473) Forms inside f-client-nav were always intercepted as partial requests because the fallback chain for rawPartialUrl ended with el.action, which is always non-empty (defaults to the current URL). This caused normal forms without f-partial to be sent with ?fresh-partial=true, breaking forms that expect a full page re-render after POST. Now only forms (or submitters) with an explicit f-partial or formaction attribute are intercepted for partial navigation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ception Forms with an explicit `action` attribute inside `f-client-nav` should still be intercepted as partials. Only forms *without* any of `f-partial`, `formaction`, or `action` attributes are left alone. Add test for forms without action inside f-client-nav to verify they submit normally without partial interception. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test for non-intercepted form submission was racing against the browser's full page navigation. Use Promise.all with waitForNavigation() to properly wait for the POST response before checking for the .submitted element. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
f-client-navwithout an explicitf-partialattribute were being intercepted as partial requests, breaking normal form submissionsRoot cause
The form submit handler's fallback chain for determining the partial URL:
Always falls through to
el.action, which defaults to the current page URL for any<form>without an explicitactionattribute. Sinceel.actionis never empty, therawPartialUrl !== ""check on the next line was alwaystrue, meaning every form insidef-client-navwas intercepted — even forms that never opted in to partial navigation.This caused:
?fresh-partial=true<Partial>fragmentsFix
Added a
hasExplicitPartialcheck that requires the form or its submitter to have an explicitf-partialorformactionattribute before intercepting. Forms without these attributes now submit normally, even insidef-client-nav.Test plan
f-client-navwithoutf-partialshould submit normally (full page reload)f-partialinsidef-client-navshould still work as partial navigation🤖 Generated with Claude Code